#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
int main()
{
    int* arr = NULL;
    arr = (int*)malloc(10* sizeof(int));
    if(arr == NULL)
    {
        printf("%s\n", strerror(errno));
        return 1;
    }
    int i = 0;
    for(i = 0; i<10;i++)
    {
        *(arr+i) = i;
    }
    for(i = 0; i<10;i++)
    {
        printf("result====%d\n", *(arr+i));
    }
    printf("===============================\n");
   int* ptr =(int*)realloc(arr, 20* sizeof(int));
   if(ptr == NULL )
   {
       printf("%s\n", strerror(errno));
       return 1;
   }
   else
       arr = ptr;
    for(i = 10; i<20;i++)
    {
        *(arr+i) = i;
    }
    for(i = 0;i<20;i++)
    {
        printf("result====%d\n", *(arr+i));
    }
    free(arr);
    arr = NULL;
    return 0;
}